export function deepClone(obj, newObj) {
    var newObj = newObj || {};
    for (let key in obj) {
        if (typeof obj[key] == 'object') {
            newObj[key] = (obj[key].constructor === Array) ? [] : {}
            deepClone(obj[key], newObj[key]);
        } else {
            newObj[key] = obj[key]
        }
    }
    return newObj;
}

let obj = {
    name:"张三",
    userInfo:{
        age:18,
        test:{
            job:"工作"
        },
        list:[
            "测试"
        ]
    }
}

let newObj = deepClone(obj)